

package com.maoshi.shop.distribution.comment.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.maoshi.shop.distribution.comment.dto.DistributionWithdrawCashDto;
import com.maoshi.shop.distribution.comment.model.DistributionUser;
import com.maoshi.shop.distribution.comment.model.DistributionUserWallet;
import com.maoshi.shop.distribution.comment.model.DistributionWithdrawCash;
import com.maoshi.shop.distribution.comment.param.RangeTimeParam;
import com.maoshi.shop.security.comment.model.AppConnect;

/**
 * @author lgh on 2019/04/01.
 */
public interface DistributionWithdrawCashService extends IService<DistributionWithdrawCash> {
    IPage<DistributionWithdrawCash> distributionWithdrawCashsPage(Page page, Long shopId, RangeTimeParam rangeTimeParam, String userMobile, DistributionWithdrawCash distributionWithdrawCash);

    IPage<DistributionWithdrawCashDto> distributionWithdrawCashDtoPageByUserId(Page page, Long distributionUserId);


    /**
     * 发起提现
     */
    void apply(Double amount, DistributionUser distributionUser, AppConnect appConnect);

    /**
     * 根据时间区间获取用户的提现次数
     *
     * @param rangeTimeParam
     * @param distributionUserId
     * @return
     */
    Integer getCountByRangeTimeAndDistributionUserId(RangeTimeParam rangeTimeParam, Long distributionUserId);

    Double getUserTotalWithdrawCash(Long walletId);

}
